<?php
/**
 * Default layout per Alessandro Pavesi
 */
defined('_JEXEC') or die('Restricted access');

global $mainframe;

// Controllo utente loggato
$user = & JFactory :: getUser();

// Se utente non loggato
if($user -> id <= 0) {

	// Redirect to login
	$uri		= JFactory::getURI();
	$return		= $uri->toString();

	$url  = 'index.php?option=com_user&view=login';
	$url .= '&return='.base64_encode($return);
	$url .= '&Itemid=95';
	$mainframe -> redirect($url, JText::_('You must login first') );
}

if(!$task) {
	$task = "forum-index";
}
?>
	
	<div id="canvas">
		<?php 
		// Includo layout header
		include($templateLoader -> getBaseTemplatePath($this, $option, $task, $Itemid, $_REQUEST) . "__header" . EC_TEMPLATE_EXT);
		?>
		
		<div id="contenuto">

			<div id="corpo-forum" class="<?php echo $task ?>">
				<jdoc:include type="component" />
				<?php 
				// Includo layout header
				include($templateLoader -> getBaseTemplatePath($this, $option, $task, $Itemid, $_REQUEST) . "__back" . EC_TEMPLATE_EXT);
				?>
			</div>
			
			<div class="pulizia"></div>
		</div>

		<?php 
		// Includo layout footer
		include($templateLoader -> getBaseTemplatePath($this, $option, $task, $Itemid, $_REQUEST) . "__footer" . EC_TEMPLATE_EXT);
		?>

	</div>